package com.qxsx.midi.activity.exam;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.LinearLayout;

import com.qxsx.midi.R;
import com.qxsx.midi.activity.base.BaseActivity;
import com.qxsx.midi.config.AppContext;
import com.qxsx.midi.utils.SPUtils;

/**
 * Created by Zrj on 2015/9/10.
 * 考试科目
 */
public class ExamSubjectActivity extends BaseActivity implements OnClickListener {

    private LinearLayout ll_one, ll_two, ll_three, ll_four;
    Intent intent = new Intent();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_exam_subject);
        setTitle("考试科目");
        setNavBtn(R.mipmap.back, 0);
        findById();
    }

    private void findById() {
        ll_one = (LinearLayout) findViewById(R.id.ll_one);
        ll_one.setOnClickListener(this);
        ll_two = (LinearLayout) findViewById(R.id.ll_two);
        ll_two.setOnClickListener(this);
        ll_three = (LinearLayout) findViewById(R.id.ll_three);
        ll_three.setOnClickListener(this);
        ll_four = (LinearLayout) findViewById(R.id.ll_four);
        ll_four.setOnClickListener(this);
    }

    @Override
    protected void HandleTitleBarEvent(TitleBar component, View v) {
        switch (component) {
            case LEFT:
                finish();
                break;
        }
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.ll_one:
                SPUtils.put(AppContext.getContext(), "subject_name", "电吉他");
                SPUtils.put(AppContext.getContext(), "apply_major_id", "2172405d-17bb-5f40-da92-cf9cc285a980");
                finish();
                break;
            case R.id.ll_two:
                SPUtils.put(AppContext.getContext(), "subject_name", "电贝司");
                SPUtils.put(AppContext.getContext(), "apply_major_id", "5bb9bcb5-88a0-9c85-0a15-39b51c1142be");

                finish();
                break;
            case R.id.ll_three:
                SPUtils.put(AppContext.getContext(), "subject_name", "爵士鼓");
                SPUtils.put(AppContext.getContext(), "apply_major_id", "cd12a552-95ee-9d9b-1efb-8c302c6b52c2");

                finish();
                break;
            case R.id.ll_four:
                SPUtils.put(AppContext.getContext(), "subject_name", "音乐理论");
                SPUtils.put(AppContext.getContext(), "apply_major_id", "87b65e6a-72fc-4617-d61b-351a7d080ed7");

                finish();
                break;
        }

    }
}
